package bg.btanev.eightyfour.repository;

import java.util.List;

import bg.btanev.eightyfour.domain.Target;
import bg.btanev.eightyfour.domain.person.Person;

/**
 *
 * @author B.Tanev
 *
 */
public interface TargetRepository {
	Target createAndStoreTarget(Person person);

	void storeTarget(Target target);

	void removeTarget(Target target);

	void flushLocalCache();

	/**
	 * Removes a {@link Target} from the persistent cache.
	 *
	 * @param target
	 */
	void removeFromLocalCache(Target target);

	void clearLocalCache();

	Target findByPerson(Person person);

	List<Target> findAllTargets();

	List<Target> findTargets(String email, String fName, String lName);

	List<Target> findAllTargetsToUpdate();

	Target findByIdentifier(Long id);

	/**
	 * Attach's the object to the current context.
	 *
	 * @param target
	 * @return
	 */
	Target reassociateTarget(Target target);
}
